package com.springcloud.platform.controller;

import com.springcloud.platform.bean.Product;
import com.springcloud.platform.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/esController")
public class EsController {

     @Autowired
     private ProductService projectService;

    @RequestMapping(value = "/getEs")
    public void getEs(){
        Product product=new Product();
        product.setName("33");
        product.setId("2");
        product.setPrice(3.3);
        projectService.save(product);
    }

    @GetMapping("/getProduct")
    public String getProduct(){
        return "getProduct";
    }
}
